'use strict';
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	  // promise方式
	  const url = event.murl
	  const name = String(event.sjc)
	  const result = await uniCloud.uploadFile({
		filePath: url,
		cloudPath: 'name.jpg'
		// ,
		// onUploadProgress: function(progressEvent) {
		//   console.log(progressEvent);
		//   var percentCompleted = Math.round(
		// 	(progressEvent.loaded * 100) / progressEvent.total
		//   );
		// }
	  });
	//返回数据给客户端
	return result
};
